UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rgQncNAfqANSnYFwVOijBbiauWDtzMC+hP6+Z7Xzql0='
WHERE
key_id = '84637964a504e9fc4230a7da7f473c8480fa4ded10d5a35b21f36949dce53b73'
AND (
token = 'rgQncNAfqANSnYFwVOijBbiauWDtzMC+hP6+Z7Xzql0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)