UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5/xGUZ3rY1PREZogNy7qk1rNg9hLOsnN0tXjMUkKor4=' 
WHERE 
  key_id = '2f0b89572affd1f195700e07335eaea359803f5cc88ed1fa4116382059d285e8' 
  AND (
    token = '5/xGUZ3rY1PREZogNy7qk1rNg9hLOsnN0tXjMUkKor4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029