UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U3EQrZZk3XAXHb+8qH7kSZ0pXccG+VgDiMqbFdImAPw=' 
WHERE 
  key_id = 'fb0a0abbe642c48b82a042f7dd4b816ead7808fce5ca8fd9c2308d836d20ac2d' 
  AND (
    token = 'U3EQrZZk3XAXHb+8qH7kSZ0pXccG+VgDiMqbFdImAPw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034