UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eq6O8m2unZyJXsZshQx68OWguo4cyZnRgx2Yp+2K+50='
WHERE
key_id = '7addfed66299fe22496147be17c1e0e1335edf178dee4cf7952f3a21c7af0aa1'
AND (
token = 'eq6O8m2unZyJXsZshQx68OWguo4cyZnRgx2Yp+2K+50='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)