UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PyE/DFXU1e3yVJwoi5FZGRAVXnjXoPjbLBdX/iaE2JY='
WHERE
key_id = 'ecf93f319ff0c51df74fc3328d139e93acf2da13effa29a7868e4e464eb8e096'
AND (
token = 'PyE/DFXU1e3yVJwoi5FZGRAVXnjXoPjbLBdX/iaE2JY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)