UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nFVTYFw9hJBq/ELV9UkDk8uOgA2D+a1VHH2JqmN+deI='
WHERE
key_id = '802a13ae883e63c7215ce04ea5244f7a82db445cac93ec11d41c15a2770ca80b'
AND (
token = 'nFVTYFw9hJBq/ELV9UkDk8uOgA2D+a1VHH2JqmN+deI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)