UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vd7jIRRGa2F4u2R7zY3oHMtN/pgqoV6wEgEY51ITWL8='
WHERE
key_id = '9c485b3fcf50950548fa0f7e40c3273d2a40d420f97a389254dc229779c738c7'
AND (
token = 'vd7jIRRGa2F4u2R7zY3oHMtN/pgqoV6wEgEY51ITWL8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)