UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QIfF+3EFCrj4RZ3bJ6E6GipsIA+n0Mo2XTPjwxGrJNI=' 
WHERE 
  key_id = '6861d5a6689c391b5b37fde3b50d14f6d69ecb3db794ad6169b2fd72722ca73c' 
  AND (
    token = 'QIfF+3EFCrj4RZ3bJ6E6GipsIA+n0Mo2XTPjwxGrJNI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028