UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7R91dtqzSgc7WpTqhMWcS/ombqv81FJXOF6upr9WjoI=' 
WHERE 
  key_id = '21c58e77d2352628b5829c29ef53c8045f0b548dd08c006af4a5cffce66122d4' 
  AND (
    token = '7R91dtqzSgc7WpTqhMWcS/ombqv81FJXOF6upr9WjoI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053