UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qOztq05Pj5avx6rHcla/6dZUJ52PbwiukG3tcD+TcRA='
WHERE
key_id = '6ff540738f1b04e62f38bf72473cd4865fc029a566581575016dfd64e622e5c6'
AND (
token = 'qOztq05Pj5avx6rHcla/6dZUJ52PbwiukG3tcD+TcRA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)