UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DVB7+Php4ttvKijsyhv6UmawEomaPLWFIiR6gz9Pgjw='
WHERE
key_id = 'bc45143948eb238ca63e1f36929db8dcdc9974b923df378fc1f1d35ff6a8723a'
AND (
token = 'DVB7+Php4ttvKijsyhv6UmawEomaPLWFIiR6gz9Pgjw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)