UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vlA677JUXiJTmEyuDCOyZTIkraBE/BWPM2ToAtLMSMA='
WHERE
key_id = '7a3f1454a11d7b2d1f5f117ffd14658d504aaa3ea3d8198baf8bcb6fe86b57ed'
AND (
token = 'vlA677JUXiJTmEyuDCOyZTIkraBE/BWPM2ToAtLMSMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)