UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b00F6aqJLAwYa+yNYy440jWzjQv37gQdWFTNPXHtfLQ=' 
WHERE 
  key_id = 'a772a1b2d058bcb5c3f8fd0a3fe84adcb90474fc45727f6dd47398abdd4276cf' 
  AND (
    token = 'b00F6aqJLAwYa+yNYy440jWzjQv37gQdWFTNPXHtfLQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039