UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gci6kOZrL6XPZxscHc2Qs9QVlN+UWA8hLT9bxy6J6SE='
WHERE
key_id = 'e877fec7ae9348f77af9f18cd6e1312e61513bb55dfc842e6679516e936658e9'
AND (
token = 'gci6kOZrL6XPZxscHc2Qs9QVlN+UWA8hLT9bxy6J6SE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)