UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MIhs2A6a+tNv89vGK7tqSepZRif+8VahOMN3QCHSR7Q='
WHERE
key_id = '09cc5161f87b508217a5fb211f1278be2bd5aea356af04c641b05acf1110b0f3'
AND (
token = 'MIhs2A6a+tNv89vGK7tqSepZRif+8VahOMN3QCHSR7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)