UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JRjN0PbgLCxBwDhiXx34IgJeOz+3eQrgBDECylgnSb4='
WHERE
key_id = 'bda1c4a2d1b2b285f8418e1bbf3099fe3e78671426d1d1683c30c71549ca0691'
AND (
token = 'JRjN0PbgLCxBwDhiXx34IgJeOz+3eQrgBDECylgnSb4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)