UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MrKV1QZoGY1MfTA61HnIHdPWRp1ehYkgjczyg1UlJQo='
WHERE
key_id = 'dce01cd4f1f682ba28d964213642cc84c6964cee0f5c0585b95fdf2bc1612051'
AND (
token = 'MrKV1QZoGY1MfTA61HnIHdPWRp1ehYkgjczyg1UlJQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)