UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '70hCkmTPqoD/2HZm998jt7jDfddJGyUPZonbkrzflpw='
WHERE
key_id = '51a6f7d4008dbe0fc60e1e2123c55d6ad0a119eab8b6680be3bbb431258fb9e1'
AND (
token = '70hCkmTPqoD/2HZm998jt7jDfddJGyUPZonbkrzflpw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)