UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cOcbuuwJfKZwyKU2202lijSNsByX5n0JSkbKwu0fyS4='
WHERE
key_id = '76e7f2fbe1295fe8b646bb54cf6eafe2c7cfbdd8ebf86cd5dc755418df84d00e'
AND (
token = 'cOcbuuwJfKZwyKU2202lijSNsByX5n0JSkbKwu0fyS4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)