UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+ccqJSvGZ94fyFvtIA9a82RWcnhnFqb3Ker328XOWBs=' 
WHERE 
  key_id = '21f31b58ca012525f164caefde1724f4224768a2da8a32ea247c564698160a15' 
  AND (
    token = '+ccqJSvGZ94fyFvtIA9a82RWcnhnFqb3Ker328XOWBs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021