UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KrDSrwesxYZ0t4RKAQZUzdlzAP/Akln9sgg/O0lYFJY=' 
WHERE 
  key_id = 'fb8740d898d2f2982bc879511686a8e0afa75538fad7334841909aac3e47bd50' 
  AND (
    token = 'KrDSrwesxYZ0t4RKAQZUzdlzAP/Akln9sgg/O0lYFJY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042