UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/lGqmiagMdDCwAyaG1kjBQuR5Vwx1L2ikQvnza8jI7k='
WHERE
key_id = '8599c6e4ce5c7ec7bf26ba84a9251730a0f3a4859d80b28b961cf81186cfbec0'
AND (
token = '/lGqmiagMdDCwAyaG1kjBQuR5Vwx1L2ikQvnza8jI7k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)