UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Gvv8uH8Se6Gv+gZMwAk0+IUtqkhZqPOuSh+H8cVJ40='
WHERE
key_id = 'eef579ed82d366188e2d12156e6796a6877526187b2e81f65a6677c89010c9d5'
AND (
token = '4Gvv8uH8Se6Gv+gZMwAk0+IUtqkhZqPOuSh+H8cVJ40='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)