UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fhYTIJGlku1jbqt1e9Z5PrQwYhIbQXdA77+F044IGZA='
WHERE
key_id = '751de5e66606bbf38ca2bb294fd1e2031a085d8c50d21518de34f7712cae5098'
AND (
token = 'fhYTIJGlku1jbqt1e9Z5PrQwYhIbQXdA77+F044IGZA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)