UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p2JaTSTQ39jGsCB4pcBuUSkzyVp4Nvx4KYELGPoKDsI='
WHERE
key_id = '6c47fbb7fa971a7aec89614676dc696b9bad032586efb3fde78cbb52bab67ce8'
AND (
token = 'p2JaTSTQ39jGsCB4pcBuUSkzyVp4Nvx4KYELGPoKDsI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)