UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '53p/fnnnd0u7fq6Ps0h2ElbrnNCuPBbJB44Mg7C17eY='
WHERE
key_id = 'd319cc50bf6230b6cd560354c455f8653ab7c13e597466d6bc6cb0fb8897a0bf'
AND (
token = '53p/fnnnd0u7fq6Ps0h2ElbrnNCuPBbJB44Mg7C17eY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)