UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wT3aqE29vjYzTBUbHJWk7GrJlYp7zYrhwoADZRFbrDg=' 
WHERE 
  key_id = 'bd23fc314e942e0737cbe8e9c7d111444fe7c002cf2a5162256f275c5b89d11b' 
  AND (
    token = 'wT3aqE29vjYzTBUbHJWk7GrJlYp7zYrhwoADZRFbrDg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034