UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q3C4lrMXO6DqRVj8lllOGVYbm/Czufyz+o5nkzGl9sU='
WHERE
key_id = 'ea619c6e60cd8a142556f2f594896b71d157ac105762b82294be221e7021521b'
AND (
token = 'Q3C4lrMXO6DqRVj8lllOGVYbm/Czufyz+o5nkzGl9sU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)