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