UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2hJMlqMllF1ZRtcGg1mMIh60BcbsKodIz/WyHXBt3RE='
WHERE
key_id = 'fb06472c23dc55508d833037ac5631fb14f16e2ecadaa57e72ee124e2e2f4109'
AND (
token = '2hJMlqMllF1ZRtcGg1mMIh60BcbsKodIz/WyHXBt3RE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)